<%@ include file="/common/taglibs.jsp"%>
<%@ taglib prefix="catalog" tagdir="/WEB-INF/tags/catalog"%>
<%@ taglib prefix="content" tagdir="/WEB-INF/tags/content"%>
<html>
	<meta name="keywords"	content="${(not empty category.keywords)?category.keywords:category.categoryName}" />
	<meta name="description"	content="${(not empty category.metaDescription)?category.metaDescription:category.categoryDescription}" />
	<head>
		<title><fmt:message key="helpCenter.title"/></title>
		<style type="text/css">
			.highlight { background: #ff0; }
		</style>
	</head>
	<body>
		<%@ include file="include/searchBar.jspf"%>
		<div class="help_center">
			<c:choose>
				<c:when test="${not empty contentList or not empty contentCategoryList}">
					<form id="searchContentListForm" name="searchContentListForm">
						<%--显示文章搜索结果 --%>
						<c:if test="${not empty contentList}">
							<div class="basic_question">
								<div class="top">
									<fmt:message key="helpCenter.searchThis"/>"${contentSearchCriteria.keywords}",
									<fmt:message key="helpCenter.result.count">
										<fmt:param>${sc.totalCount}</fmt:param>
									</fmt:message>
								</div>
								
								<ul class="content clearfix" id="resultList">
									<c:forEach items="${contentList}" var="content" varStatus="contentStatus">
										<li><a href="<content:contentUrl content="${content}"/>" target="_blank">${content.contentTitle}</a></li>
									</c:forEach>
								</ul>
								<%@ include file="../../content/include/contentSearchCriteriaStorage.jspf"%>
								<div class="page_bottom clearfix">
									<paging:linkPagingBottom/>
								</div>
							</div>
						</c:if>
						
						<%--显示内容目录搜索结果 --%>
						<c:if test="${not empty contentCategoryList}">
							<div class="block1">
								<dl class="clearfix">
									<dt><fmt:message key="helpCenter.relatedCategory"/></dt>
									<c:forEach items="${contentCategoryList}" var="contentCategory">
										<dd><a href='<catalog:contentCategoryUrl categoryId="${contentCategory.categoryId}"/>' target="_blank">${contentCategory.categoryName}</a></dd>
									</c:forEach>
								</dl>
							</div>
						</c:if>
					</form>	
					
				</c:when>
				<c:otherwise>
					<div class="msg">
						<h3><fmt:message key="helpCenter.noSearchResult.msg.title"/></h3>
						<div class="recommend_info">
							<dl>
								<dt><fmt:message key="helpCenter.noSearchResult.msg.advice"/>：</dt>
								<dd><fmt:message key="helpCenter.noSearchResult.msg.advice1"/></dd>
								<dd><fmt:message key="helpCenter.noSearchResult.msg.advice2"/></dd>
								<dd><fmt:message key="helpCenter.noSearchResult.msg.advice3"/></dd>
							</dl>
						</div>
					</div>
				</c:otherwise>	
			</c:choose>
			
		</div>
		
		<c:set var="plugin_highlight" value="true" scope="request"/>
		<script type="text/javascript">
		$j(document).ready(function () {
			//stat:高亮搜索结果
			<c:if test="${not empty contentList}">
				if("${contentSearchCriteria.keywords}".trim() != ""){
					 var searchValues = "${contentSearchCriteria.keywords}".trim().replace(/\s+/,"|").split("|");
					 highlight($('resultList'),searchValues); 
				} 
			</c:if>
			//end:高亮搜索结果 
		});	
		</script>
	</body>
</html>
